import request from '@/utils/request'

//查询列表页数据
export function queryPageList(data) {
  return request({
    url: '/crm/crmProduct/queryPageList',
    method: 'post',
    data: data
  })
}
//新增数据
export function addProduct(data) {
  return request({
    url: '/crm/product/add',
    method: 'post',
    data:data,
  })
}
//根据ID查询
export function queryByIdProduct(ProductId) {
  return request({
    url: '/crm/crmProduct/queryById/'+ProductId,
    method: 'post',
  })
}
//查询详情页信息
export function informationProduct(customerId,data) {
  return request({
    url: '/crm/crmProduct/information/'+customerId,
    method: 'post',
  })
}
//基本信息保存修改
export function updateInformationProduct(data) {
  return request({
    url: '/crm/crmProduct/updateInformation',
    method: 'post',
    data:data,
  })
}
//查询新增所需字段
export function queryProductField(id) {
  return request({
    url: '/crm/product/field/'+id,
    method: 'post',
  })
}
//修改数据
export function updateProduct(data) {
  return request({
    url: '/crm/product/update',
    method: 'post',
    data:data,
  })
}
//修改上架状态
export function updateProductStatus(data) {
  return request({
    url: '/crm/crmProduct/updateStatus',
    method: 'post',
    data:data,
  })
}
//删除
export function deleteByIds(data) {
  return request({
    url: '/crm/crmProduct/deleteByIds',
    method: 'post',
    data:data,
  })
}


//----------------------------------------
//客户标星
export function starProduct(ProductId) {
  return request({
    url: '/crm/crmProduct/star/'+ProductId,
    method: 'post',
  })
}



//添加客户地址
export function saveAddress(data) {
  return request({
    url: '/crm/crmProduct/saveAddress',
    method: 'post',
    data:data,
  })
}
//添加客户地址
export function queryAddressById(ProductId) {
  return request({
    url: '/crm/crmProduct/queryAddressById/'+ProductId,
    method: 'post',
  })
}
//作废客户地址
export function cancellationAddress(data) {
  return request({
    url: '/crm/crmProduct/cancellationAddress',
    method: 'post',
    data:data,
  })
}

//设置住地址
export function setIsMain(data) {
  return request({
    url: '/crm/crmProduct/setIsMain',
    method: 'post',
    data:data,
  })
}
//编辑客户地址
export function updateAddress(data) {
  return request({
    url: '/crm/crmProduct/updateAddress',
    method: 'post',
    data:data,
  })
}


//客户放入公海
export function updateProductByIds(data) {
  return request({
    url: '/crm/crmProduct/updateProductByIds',
    method: 'post',
    data:data,
  })
}
